//
//  MKUICustomTabBarController.h
//  MKUI
//  仿照系统的UITabBarController，定义一个可高度自定义的标签控制器。底部tarBar的背景颜色、背景图片、半透明度、高度值以及每个tarBarItem的显示视图，均可以进行自定义。
//  Created by 苏尚进 on 2023/8/2.
//  Copyright © 2023 moon. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "MKUICustomTabBar.h"

NS_ASSUME_NONNULL_BEGIN

@class MKUICustomTabBarController;
@class MKUICustomTabBar;
@protocol MKUICustomTabBarControllerDelegate <NSObject>
@optional
- (BOOL)customTabBarController:(MKUICustomTabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController;//用户点击tabBar的item时触发，返回YES才会继续调用[customTabBarController:didSelectViewController:]，并设置选中控制器值。可以在此方法中拦截点击事件，并做出自定义的操作，如取消选中效果，触发自定义的逻辑。
- (void)customTabBarController:(MKUICustomTabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController;//用户点击了tarBar的item时触发，即使再次点击选中项，也会触发

- (UIInterfaceOrientationMask)customTabBarControllerSupportedInterfaceOrientations:(MKUICustomTabBarController *)tabBarController API_AVAILABLE(ios(7.0)) API_UNAVAILABLE(tvos);
- (UIInterfaceOrientation)customTabBarControllerPreferredInterfaceOrientationForPresentation:(MKUICustomTabBarController *)tabBarController API_AVAILABLE(ios(7.0)) API_UNAVAILABLE(tvos);

//- (nullable id <UIViewControllerInteractiveTransitioning>)customTabBarController:(MKUICustomTabBarController *)tabBarController interactionControllerForAnimationController:(id <UIViewControllerAnimatedTransitioning>)animationController API_AVAILABLE(ios(7.0));
//
//- (nullable id <UIViewControllerAnimatedTransitioning>)customTabBarController:(MKUICustomTabBarController *)tabBarController animationControllerForTransitionFromViewController:(UIViewController *)fromVC toViewController:(UIViewController *)toVC  API_AVAILABLE(ios(7.0));
@end


@interface MKUICustomTabBarController : UIViewController<MKUItemFlowCollectionViewDelegate>
@property(nullable, nonatomic,copy) NSArray<__kindof UIViewController *> *viewControllers;
- (void)setViewControllers:(NSArray<__kindof UIViewController *> * __nullable)viewControllers animated:(BOOL)animated;
@property(nullable, nonatomic, strong) __kindof UIViewController *selectedViewController;
@property(nonatomic) NSUInteger selectedIndex;
@property(nullable, nonatomic,weak) id<MKUICustomTabBarControllerDelegate> delegate;

/// 底部的tabBar视图，如果需要设置默认的tarBarItem显示视图，可以设置tabBar.itemCellClass属性
@property(nonatomic,readonly) MKUICustomTabBar *tabBar;
@end

@interface UIViewController(MKUICustomTabBarController)
@property(nonatomic,readonly,nullable) MKUICustomTabBarController *mk_customTabBarController;
@end
NS_ASSUME_NONNULL_END
